#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int i,j;
	int a[n+1][n+1]={0};
	for(i=1;i<=n;i++){
		for(j=i+1;j<=n;j++){
			cin>>a[i][j];
		};
	};
	int minn;
	int ans[n+1];
	ans[n]=0;
	ans[n-1]=a[n-1][n];
	for(i=n-2;i>0;i--){
		minn=a[i][n];
		for(j=i+1;j<n;j++){
			minn=min(a[i][j]+ans[j],minn);
		};
		ans[i]=minn;
	};
	cout<<ans[1];
	return 0;
}
